package com.itheima.controller.impl;

import com.itheima.controller.IManagerController;
import com.itheima.domain.Manager;
import com.itheima.service.IManagerService;
import com.itheima.service.impl.ManagerServiceImpl;

import java.util.ArrayList;

public class ManagerControllerImpl implements IManagerController {
    private IManagerService service= new ManagerServiceImpl();

    @Override
    public boolean login(String sid, String name) {
       ArrayList<Manager> list=service.findAll();
        for (Manager manager : list) {
            if(manager.getSid().equals(sid)&&manager.getName().equals(name)){
                return true;
            }
        }
        return false;
    }
}
